package com.bblocks.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 文件读取的工具类
 */
public class PropertiesUtil {
    public static String imgType = PropertiesUtil.getValue("imgType");
    // 读取 properties 配置文件里的路径
    public static String getValue(String names) {
        Properties prop = new Properties();
        InputStream in = PropertiesUtil.class.getResourceAsStream("/app.properties");
        try {
            prop.load(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return prop.getProperty(names);
    }

    public static String getappLicaTionValue(String names) {
        Properties prop = new Properties();
        InputStream in = PropertiesUtil.class.getResourceAsStream("/application.properties");
        try {
            prop.load(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return prop.getProperty(names);
    }


}
